package org.csu.mybigpro.controller;

import org.csu.mybigpro.domain.CourseSection;
import org.csu.mybigpro.service.CourseSectionService;
import org.csu.mybigpro.common.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/resources")
public class CourseSectionController {
    @Autowired
    private CourseSectionService courseSectionService;


    // 获取资源对应的章节信息（只读）
//    @GetMapping("/resources/{id}/sections")
//    public CommonResponse<List<CourseSection>> getResourceSections(@PathVariable("id") Long resourceId) {
//        try {
//            List<CourseSection> sections = courseSectionService.getSectionsByResourceId(resourceId);
//            return CommonResponse.createForSuccess(sections);
//        } catch (Exception e) {
//            return CommonResponse.createForError(500, "获取章节失败");
//        }
//    }

}
